/*
 * main.c
 *
 *  Created on: Jan 30, 2013
 *      Author: justin
 */
#include "project.h"
//#include "FSM.h"

int main() {

	/*initialize serial*/
	xSerialPortInitMinimal(115200,150,150);
	DDRF = 0xff;
	PORTF = 0xee;
	/*start creating tasks*/
	xTaskCreate(HstTgtFSM_machine,(signed portCHAR*)"Main_FSM_machine",configMINIMAL_STACK_SIZE,NULL,0,NULL);
//	xTaskCreate(ioTask,		//defined in mytasks.h
//			(signed portCHAR *)"ioTask",configMINIMAL_STACK_SIZE,NULL,2,NULL);
//	xTaskCreate(usartRxPacket,(signed portCHAR*)"usart_packet_Rx_handler",configMINIMAL_STACK_SIZE,NULL,0,NULL);
//	xTaskCreate(usartTxPacket,(signed portCHAR*)"usart_packet_Tx_handler",configMINIMAL_STACK_SIZE,NULL,0,NULL);
//	xTaskCreate(twiRxPacket,(signed portCHAR*)"twi_packet_Rx_handler",configMINIMAL_STACK_SIZE,NULL,0,NULL);
//	xTaskCreate(twiTxPacket,(signed portCHAR*)"twi_packet_Tx_handler",configMINIMAL_STACK_SIZE,NULL,0,NULL);
//	Call the scheduler function
	PORTF = 0xea;    //#debug success reaching here..
	vTaskStartScheduler();    //Begin the task scheduler


	uint8_t i = 0;
	while (1){
//		PORTB=i++;	//reboots after a while for some reason.
	}
}
